//
//  IComMediator+RedPacketModuleActions.m
//  ICome
//
//  Created by luoziheng on 2016/11/9.
//  Copyright © 2016年 iCom. All rights reserved.
//

#import "IComMediator+RedPacketModuleActions.h"

//模块的常量
// action 类名 Mine 模块统一用Mine
NSString * const kIComMediatorTargetMyRedPacket = @"RedPacket";
// 类对应方法名
NSString * const kIComNativeFetchMyRedPacketViewController = @"nativeFetchMyRedPacketViewController";
NSString * const kIComNativeFetchRedPacketPasswordViewController = @"nativeFetchRedPacketPasswordViewController";
NSString * const kIComNativeFetchRedPacketSingleViewController = @"nativeFetchRedPacketSingleViewController";
NSString * const kIComNativeFetchRedPacketGroupViewController = @"nativeFetchRedPacketGroupViewController";
NSString * const kIComNativeFetchRedPacketResultViewController = @"nativeFetchRedPacketResultViewController";


@implementation IComMediator (RedPacketModuleActions)

- (UIViewController *)IComMediator_MyRedPacketViewController {
    return [self IComMediator_MyRedPacketViewController:nil];
}

// 我的红包
- (UIViewController *)IComMediator_MyRedPacketViewController:(NSDictionary *)params {
    UIViewController *viewController = [self performTarget:kIComMediatorTargetMyRedPacket
                                                    action:kIComNativeFetchMyRedPacketViewController
                                                    params:params];
    if ([viewController isKindOfClass:[UIViewController class]]) {
        return viewController;
    } else {
        return [[UIViewController alloc] init];
    }
}

// 修改密码
- (UIViewController *)IComMediator_RedPacketPasswordViewController:(NSDictionary *)params {
    UIViewController *viewController = [self performTarget:kIComMediatorTargetMyRedPacket
                                                    action:kIComNativeFetchRedPacketPasswordViewController
                                                    params:params];
    if ([viewController isKindOfClass:[UIViewController class]]) {
        return viewController;
    } else {
        return [[UIViewController alloc] init];
    }
}

// 单人红包
- (UIViewController *)IComMediator_RedPacketSingleViewController:(NSDictionary *)params {
    UIViewController *viewController = [self performTarget:kIComMediatorTargetMyRedPacket
                                                    action:kIComNativeFetchRedPacketSingleViewController
                                                    params:params];
    if ([viewController isKindOfClass:[UIViewController class]]) {
        return viewController;
    } else {
        return [[UIViewController alloc] init];
    }
}

// 群组红包
- (UIViewController *)IComMediator_RedPacketGroupViewController:(NSDictionary *)params {
    UIViewController *viewController = [self performTarget:kIComMediatorTargetMyRedPacket
                                                    action:kIComNativeFetchRedPacketGroupViewController
                                                    params:params];
    if ([viewController isKindOfClass:[UIViewController class]]) {
        return viewController;
    } else {
        return [[UIViewController alloc] init];
    }
}

// 红包结果
- (UIViewController *)IComMediator_RedPacketResultViewController:(NSDictionary *)params {
    UIViewController *viewController = [self performTarget:kIComMediatorTargetMyRedPacket
                                                    action:kIComNativeFetchRedPacketResultViewController
                                                    params:params];
    if ([viewController isKindOfClass:[UIViewController class]]) {
        return viewController;
    } else {
        return [[UIViewController alloc] init];
    }
}

@end
